//
//  BaseModel.m
//  MagicBox
//
//  Created by dllo on 16/8/9.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    
}

- (void)setNilValueForKey:(NSString *)key{
    
    
}


- (instancetype)initWithDic:(NSDictionary *)dic {
    
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}



+(instancetype)baseModelWithDic:(NSDictionary *)dic{
   
    id model = [[[self class] alloc]initWithDic:dic];
    
    return model;
    
}



+(NSArray *)arrayFromArray:(NSArray *)array{
    
    NSMutableArray *mulArray = [NSMutableArray array];
    
    
    for (NSDictionary *dic in array) {
      
        id model = [[self class] baseModelWithDic:dic];
        [mulArray addObject:model];
                }

    return [NSArray arrayWithArray:mulArray];
    
    
}









@end
